<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="jakarta.faces.core"
      xmlns:ui="jakarta.faces.facelets"
      xmlns:p="primefaces" 
      xmlns:h="jakarta.faces.html">
    <h:head>
        <h:outputStylesheet library="webjars" name="primeflex/3.3.1/primeflex.min.css" />     
        <title>Blog</title>
    </h:head>
    <h:body>
        <h:form prependId="false">
            <div class="flex align-items-center justify-content-center">
                <div class="surface-card p-4 shadow-2 border-round w-full lg:w-6">
                    <div>
                        <label for="blog-title" class="block text-900 font-medium mb-2">标题</label>
                        <p:inputText id="blog-title" styleClass="w-full mb-3" value="#{editBlogView.blog.title}"/>

                        <label for="blog-category" class="block text-900 font-medium mb-2">分类</label>
                        <p:selectOneMenu id="blog-category" value="#{editBlogView.blog.category}" editable="true" styleClass="mb-3">
                            <f:selectItems value="#{editBlogView.categories}"/>
                        </p:selectOneMenu>
                        <label for="blog-contect" class="block text-900 font-medium mb-2">正文</label>
                        <p:textEditor id="blog-contect" value="#{editBlogView.blog.content}" secure="false" styleClass="mb-3" height="400px;"/>

                        <p:commandButton value="发布" action="#{editBlogView.updateBlog}"/>
                    </div>
                </div>
            </div>    
        </h:form>
    </h:body>
</html>
